package de.fhffm.tables;



import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Persistence;

@Entity
public class Art {
	
	@Id
	@GeneratedValue( strategy = GenerationType.IDENTITY )
	private int artID;
	
	//@Column(nullable = true, unique = true, name = "ART" ) 
	private String art;
		
	@OneToMany (mappedBy="art", cascade = CascadeType.ALL)
	private List<Pflanze> pflanzen = new ArrayList<Pflanze>();
	
	public List<Pflanze> getPflanze(){
		return pflanzen;
	}
	
	public void setPflanzen(List<Pflanze> pflanzen){
		this.pflanzen = pflanzen;
	}
	
	public int getArtID() {
		return artID;
	}
	public void setArtID(int artID) {
		this.artID = artID;
	}
	public String getArt() {
		return art;
	}
	public void setArt(String art) {
		this.art = art;
	}
	
	public void fromStringArt(String artS){
		art = artS;
	}

	

	

}
